import os
from components.nacos.service import pull_config


def get_config(name, default=None):
    # 读取顺序：nacos > env.ini > default
    nacos_config = pull_config('public')
    if name in nacos_config:
        return nacos_config[name]
    return os.getenv(name, default)
